Allow builder to add notebook pages
authorMatthias Clasen <mclasen@redhat.com>
Wed, 20 Feb 2019 16:43:15 +0000 (11:43 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 21 Feb 2019 05:31:17 +0000 (00:31 -0500)
gtk/gtknotebook.c

index fabbfe7ee5620dc41393d3cd12f3ccb127283aa8..1566aacfb39443192c9e01d8c5d9d622c6ff4627 100644 (file)
@@ -716,6 +716,9 @@ static GList * gtk_notebook_search_page      (GtkNotebook      *notebook,
                                               gboolean          find_visible);
 static void  gtk_notebook_child_reordered    (GtkNotebook      *notebook,
                                               GtkNotebookPage  *page);
+static gint gtk_notebook_insert_notebook_page (GtkNotebook     *notebook,
+                                               GtkNotebookPage *page,
+                                               int              position);
 
 /*** GtkNotebook Size Allocate Functions ***/
 static void gtk_notebook_pages_allocate      (GtkNotebook      *notebook,
@@ -1376,7 +1379,11 @@ gtk_notebook_buildable_add_child (GtkBuildable  *buildable,
 {
   GtkNotebook *notebook = GTK_NOTEBOOK (buildable);
 
-  if (GTK_IS_WIDGET (child))
+  if (GTK_IS_NOTEBOOK_PAGE (child))
+    {
+      gtk_notebook_insert_notebook_page (notebook, GTK_NOTEBOOK_PAGE (child), -1);
+    }
+  else if (GTK_IS_WIDGET (child))
     {
       if (type && strcmp (type, "tab") == 0)
         {